package com.xhlj.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用来记录系统中的操作日志
 * @TableName sys_log
 */
@Data
@TableName(value ="sys_log")
public class SysLog implements Serializable {
    /**
     * 日志id
     */
    @TableId(type = IdType.AUTO)
    private Integer logId;

    /**
     * 操作人员的用户名
     */
    private String operator;

    /**
     * 操作类型
     */
    private String operateType;

    /**
     * 操作描述
     */
    private String operateDesc;

    /**
     * 日志时间
     */
    private Date logTime;

    /**
     * 操作地址
     */
    private String operateAddress;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 日志id
     */
    public Integer getLogId() {
        return logId;
    }

    /**
     * 日志id
     */
    public void setLogId(Integer logId) {
        this.logId = logId;
    }

    /**
     * 操作人员的用户名
     */
    public String getOperator() {
        return operator;
    }

    /**
     * 操作人员的用户名
     */
    public void setOperator(String operator) {
        this.operator = operator;
    }

    /**
     * 操作类型
     */
    public String getOperateType() {
        return operateType;
    }

    /**
     * 操作类型
     */
    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }

    /**
     * 操作描述
     */
    public String getOperateDesc() {
        return operateDesc;
    }

    /**
     * 操作描述
     */
    public void setOperateDesc(String operateDesc) {
        this.operateDesc = operateDesc;
    }

    /**
     * 日志时间
     */
    public Date getLogTime() {
        return logTime;
    }

    /**
     * 日志时间
     */
    public void setLogTime(Date logTime) {
        this.logTime = logTime;
    }

    /**
     * 操作地址
     */
    public String getOperateAddress() {
        return operateAddress;
    }

    /**
     * 操作地址
     */
    public void setOperateAddress(String operateAddress) {
        this.operateAddress = operateAddress;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysLog other = (SysLog) that;
        return (this.getLogId() == null ? other.getLogId() == null : this.getLogId().equals(other.getLogId()))
            && (this.getOperator() == null ? other.getOperator() == null : this.getOperator().equals(other.getOperator()))
            && (this.getOperateType() == null ? other.getOperateType() == null : this.getOperateType().equals(other.getOperateType()))
            && (this.getOperateDesc() == null ? other.getOperateDesc() == null : this.getOperateDesc().equals(other.getOperateDesc()))
            && (this.getLogTime() == null ? other.getLogTime() == null : this.getLogTime().equals(other.getLogTime()))
            && (this.getOperateAddress() == null ? other.getOperateAddress() == null : this.getOperateAddress().equals(other.getOperateAddress()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLogId() == null) ? 0 : getLogId().hashCode());
        result = prime * result + ((getOperator() == null) ? 0 : getOperator().hashCode());
        result = prime * result + ((getOperateType() == null) ? 0 : getOperateType().hashCode());
        result = prime * result + ((getOperateDesc() == null) ? 0 : getOperateDesc().hashCode());
        result = prime * result + ((getLogTime() == null) ? 0 : getLogTime().hashCode());
        result = prime * result + ((getOperateAddress() == null) ? 0 : getOperateAddress().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", logId=").append(logId);
        sb.append(", operator=").append(operator);
        sb.append(", operateType=").append(operateType);
        sb.append(", operateDesc=").append(operateDesc);
        sb.append(", logTime=").append(logTime);
        sb.append(", operateAddress=").append(operateAddress);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}